<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  import { removeToken } from '@/utils/auth'
  export default {
    name: 'app',
    computed: {
      ...mapGetters([
        'info', // 验证码
      ]),
    },
    created() {
      if (sessionStorage.comLevel) {
        localStorage.level = sessionStorage.comLevel
        localStorage.name = sessionStorage.comName
      }

      window.addEventListener('beforeunload', e => {
        if (JSON.parse(sessionStorage.name) === JSON.parse(localStorage.name)) {
          localStorage.removeItem('level')
          localStorage.removeItem('name')
        }
      })
      window.addEventListener('unload', e => {
        if (JSON.parse(sessionStorage.name) === JSON.parse(localStorage.name)) {
          localStorage.removeItem('level')
          localStorage.removeItem('name')
        }
      })
    },
  }
</script>
<style>
  body,html{
    width: 100%;
    height:100%;
    overflow-y: hidden;
  }
  #app{
      width: 100%;
      height:100%;
   }
</style>
